using System;
using System.Collections.Generic;


namespace LiveCS.Models
{
	[Serializable]
	public class Userlog: IEquatable<Userlog>
	{

		#region Private Members

		private User _userid; 
		private DateTime _logintime; 
		private DateTime _logouttime; 		
		#endregion

		#region Constructor

		public Userlog()
		{
			_userid = new User(); 
			_logintime = DateTime.MinValue; 
			_logouttime = DateTime.MinValue; 
		}
		#endregion // End of Default ( Empty ) Class Constuctor

		#region Public Properties
			
		public virtual User Userid
		{
			get
			{ 
				return _userid;
			}
			set
			{
				_userid = value;
			}

		}
			
		public virtual DateTime LoginTime
		{
			get
			{ 
				return _logintime;
			}
			set
			{
				_logintime = value;
			}

		}
			
		public virtual DateTime LogoutTime
		{
			get
			{ 
				return _logouttime;
			}
			set
			{
				_logouttime = value;
			}

		}
			
				
		#endregion 

		#region Public Functions

		#endregion //Public Functions

		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			if( ( obj == null ) || ( obj.GetType() != this.GetType() ) ) return false;
			Userlog castObj = (Userlog)obj; 
			return castObj.GetHashCode() == this.GetHashCode();
		}
		
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
			return this.GetType().FullName.GetHashCode();
				
		}
		#endregion
		
		#region IEquatable members

		public bool Equals(Userlog other)
		{
			if (other == this)
				return true;
		
			return other.GetHashCode() == this.GetHashCode();
				   
		}

		#endregion
		
	}
}
